Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

[2023-08-28] wooyeol #144#167

Merged
Woo-Yeol merged 1 commit into
mainfrom
wooyeol-#144
Aug 29, 2023
Merged

[2023-08-28] wooyeol #144#167
Woo-Yeol merged 1 commit into
mainfrom
wooyeol-#144

Conversation

@Woo-Yeol
Copy link
Copy Markdown
Member

압축
https://school.programmers.co.kr/learn/courses/30/lessons/17684

풀이시간 22:30 ~ 23:00 | 23:53 ~ 00:27 (1시간 4분)

시간복잡도
O(n) - n은 msg의 길이(1~1000)

접근법
무슨 알고리즘으로 풀이 할 수 있을까? -> 구현

  1. W(현재 입력) 값을 찾기
    • 가장 긴 사전에 있는 문자열 w를 찾기
  2. 가장 긴 W의 사전 인덱스 값을 answer에 삽입
  3. W+C를 사전에 등록하기

@Woo-Yeol Woo-Yeol requested a review from limstonestone August 27, 2023 16:37
@Woo-Yeol Woo-Yeol self-assigned this Aug 27, 2023
@Woo-Yeol Woo-Yeol linked an issue Aug 27, 2023 that may be closed by this pull request
@Woo-Yeol Woo-Yeol changed the title Create 압축 wooyeol.py [2023-08-28] wooyeol #144 Aug 27, 2023
Copy link
Copy Markdown
Contributor

@limstonestone limstonestone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1번 단계와 3번 단계의 조건문을 적절히 합치는(분리하는?) 방법이 없었을까요?!
전체적인 풀이 로직은 비슷한 것 같습니다!!
저는 chr 함수에 알파벳 숫자를 까먹어서 못썼어요 ㅋㅋㅋ 이번 기회에 다시 상기하고 갑니다 .. ㅎ
감사합니다 ~!

Copy link
Copy Markdown
Contributor

@zsmalla zsmalla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주석을 활용해 절차별로 코드를 구분해주셔서 읽기에 편했습니다. 저는 인덱스를 활용해 우열님과 거의 동일하게 문제를 풀 수 있었던 것 같아요! 이렇게 직접 문자열을 활용하는 편도 이해하기 쉽고 좋았던 것 같습니다.

Comment thread Programmers/압축/wooyeol.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

문제에 주어진 조건대로 구현하시고 주석을 달아주셔서 직관적으로 이해가 되는 코드인것 같아요! 👍👍👍

@Woo-Yeol Woo-Yeol merged commit 54e205c into main Aug 29, 2023
@Woo-Yeol Woo-Yeol deleted the wooyeol-#144 branch August 29, 2023 03:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Programmers] 압축

4 participants